package com.solution.common.entity;

import java.io.Serializable;

import com.solution.admin.customer.entity.CompanyEntity;
import com.solution.admin.customer.entity.CustomerEntity;

/**
 * 用户认证主体
 * 
 * @author llp
 * @date 2017/4/28
 */
public class UserPrincipal implements Serializable {
	private static final long serialVersionUID = -4323447465834025001L;

	/**
	 * 用户id （主键）
	 */
	private Long id;
	/**
	 * 账号
	 */
	private String userCode;
	/**
	 * 用户姓名
	 */
	private String userName;
	/**
	 * 密码
	 */
	private String password;
	/**
	 * 记得我
	 */
	private String rememberMe;
	/**
	 * 令牌
	 */
	private String token;

	/**
	 * 经销商ID
	 */
	private Long dealerId;

	/**
	 * 经销商名称
	 */
	private String dealerName;
	/**
	 * 用户类型
	 */
	private Integer userType;
	
	/**
	 * 如果是客户登录，会话中保存客户信息
	 */
	private CustomerEntity customer;
	/**
	 * 单位信息
	 */
	private CompanyEntity company;
	
	/**
	 * 用户数据权限类型
	 */
	private String userAuthType;

	public UserPrincipal(Long id, String userCode, String userName,
			String password, String rememberMe, String token, Long dealerId,
			String dealerName,Integer userType) {
		super();
		this.id = id;
		this.userCode = userCode;
		this.userName = userName;
		this.password = password;
		this.rememberMe = rememberMe;
		this.token = token;
		this.dealerId = dealerId;
		this.dealerName = dealerName;
		this.userType=userType;
	}

	public UserPrincipal(Long id, String userCode, String userName,
			String password, String rememberMe, String token) {
		super();
		this.id = id;
		this.userCode = userCode;
		this.userName = userName;
		this.password = password;
		this.rememberMe = rememberMe;
		this.token = token;
		this.dealerId = 0L;
		this.dealerName = "";
	}

	public UserPrincipal() {
		super();
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRememberMe() {
		return rememberMe;
	}

	public void setRememberMe(String rememberMe) {
		this.rememberMe = rememberMe;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getDealerId() {
		return dealerId;
	}

	public void setDealerId(Long dealerId) {
		this.dealerId = dealerId;
	}

	public String getDealerName() {
		return this.dealerName;
	}

	public void setDealerName(String dealerName) {
		this.dealerName = dealerName;
	}

	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	public CustomerEntity getCustomer() {
		return customer;
	}

	public void setCustomer(CustomerEntity customer) {
		this.customer = customer;
	}
	
	public CompanyEntity getCompany() {
		return company;
	}

	public void setCompany(CompanyEntity company) {
		this.company = company;
	}

	public String getUserAuthType() {
		return userAuthType;
	}

	public void setUserAuthType(String userAuthType) {
		this.userAuthType = userAuthType;
	}
	
}
